﻿using Core.Entities;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;

namespace Core.Tools
{
    public static class RegularHelper
    {
        /// <summary> 匹配一个手机号 </summary>
        public static readonly Regex MobileRegex;
        /// <summary> 匹配一个用户名 </summary>
        public static readonly Regex UserNameRegex;
        /// <summary> 匹配一个密码 </summary>
        public static readonly Regex PasswordRegex;
        /// <summary> 匹配一个日期类型 </summary>
        public static readonly Regex DateTimeRegex;

        static RegularHelper()
        {
            MobileRegex = new Regex(@"^(\+[0-9]{2,4})?1[0-9]{10}$");
            UserNameRegex = new Regex(@"^[0-9A-Za-z]{6,16}$");
            PasswordRegex = new Regex(@"^.{6,16}$");
            DateTimeRegex = new Regex("^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$");

        }
    }
}
